package com.jck.ws.component.model;

import java.util.Collection;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

/**
 * 用户主要信息及security
 */
public class UserPrincipal extends User {

	private static final long serialVersionUID = -4735218819792872573L;

	private String nickname;

	private String avatar;

	/**
	 * Instantiates a new User principal.
	 *
	 * @param username    the username
	 * @param password    the password
	 * @param authorities the authorities
	 */
	public UserPrincipal(String username, String password, Collection<? extends GrantedAuthority> authorities) {
		super(username, password, authorities);
	}

	/**
	 * Instantiates a new User principal.
	 *
	 * @param username              the username
	 * @param password              the password
	 * @param enabled               the enabled
	 * @param accountNonExpired     the account non expired
	 * @param credentialsNonExpired the credentials non expired
	 * @param accountNonLocked      the account non locked
	 * @param authorities           the authorities
	 */
	public UserPrincipal(String username, String password, boolean enabled, boolean accountNonExpired,
			boolean credentialsNonExpired, boolean accountNonLocked,
			Collection<? extends GrantedAuthority> authorities) {
		super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
	}

	/**
	 * Gets nickname.
	 *
	 * @return the nickname
	 */
	public String getNickname() {
		return nickname;
	}

	/**
	 * Sets nickname.
	 *
	 * @param nickname the nickname
	 */
	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	/**
	 * Gets avatar.
	 *
	 * @return the avatar
	 */
	public String getAvatar() {
		return avatar;
	}

	/**
	 * Sets avatar.
	 *
	 * @param avatar the avatar
	 */
	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}
}
